package com.winning.pmph.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import javax.persistence.Table;
import java.util.List;

/**
 * @author 刘亚飞
 * @Description
 * @create 2021-03-16 17:25
 */
@Data
@Table(name = "task")
public class Task extends BaseEntity {

    private static final long serialVersionUID = -7552594580941830668L;

    /**
     * Task status: searchParam, all.
     */
    public static final String SYSTEM_TYPE_ALL = "all";

    /**
     * Task status: searchParam, all.
     */
    public static final int STATUS_ALL = -1;

    /**
     * Task status: Task has not been started.
     */
    public static final int STATUS_NOT_STARTED = 0;

    /**
     * Task status: Task has been started.
     */
    public static final int STATUS_STARTED = 1;

    /**
     * Task status: Task has been stopped.
     */
    public static final int STATUS_STOPPED = 2;

    /**
     * Task status: Task has been finished.
     */
    public static final int STATUS_FINISHED = 3;

    /**
     * 未删除
     */
    public static final int NOT_DELETED = 0;

    /**
     * 删除
     */
    public static final int DELETED = 1;

    /**
     * 审核级别：初审
     */
    public static final int AUDIT_LEVEL_ONE = 1;

    /**
     * 审核级别：复审
     */
    public static final int AUDIT_LEVEL_TWO = 2;

    /**
     * 审核级别：终审
     */
    public static final int AUDIT_LEVEL_THREE = 3;

    /**
     * ID
     */
    @TableId
    private String id;
    /**
     * 任务名称
     */
    private String name;
    /**
     * 是否支持自建  0 否 1 是
     */
    private int enableCreate;
    /**
     * 审核级别  1 初审 2 复审 3 终审
     */
    private int auditLevel;
    /**
     * 体系类型 knowledge:知识  calc:医学计算器 flowchart:流程图
     *
     * @see com.winning.pmph.enumeration.KnowledgeSystem
     */
    private String systemType;
    /**
     * 当system_type是knowledge时，该字段有值，对应知识库ID
     */
    private String knowledgeLibId;
    /**
     * 任务状态  0 未启动 1 启动/进行中 2 停止 3 结束/已完成
     */
    private int status;
    /**
     * 删除  0 未删除 1 删除
     */
    private int deleted;
    /**
     * 任务开始时间
     */
    private String startDate;
    /**
     * 任务结束时间
     */
    private String endDate;
    /**
     * 备注
     */
    private String remark;
    /**
     * 编辑进度(冗余字段, 定时更新, 便于查询展示)
     */
    private Integer editPercent;
    /**
     * 编辑进度(冗余字段, 定时更新, 便于查询展示)
     */
    private Integer auditPercent;
    @TableField(exist = false)
    private List<Integer> editPercentRange;
    @TableField(exist = false)
    private List<Integer> auditPercentRange;
    @TableField(exist = false)
    private List<TaskItem> taskItemList;
    @TableField(exist = false)
    private List<TaskFile> taskFileList;
    @TableField(exist = false) // 前端使用
    private boolean selected;
    @TableField(exist = false)
    private List<String> dateRange;
    @TableField(exist = false)
    private Integer nameSuggestionCount;
}
